// ignore_for_file: file_names

import 'package:flutter/material.dart';

class MyApp7 extends StatelessWidget {
  const MyApp7({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        // 1.1 导航
        appBar: AppBar(
          title: const Text('Row组件'),
          backgroundColor: Colors.pink,
        ),
        // 1.2 主体内容
        body: Center(
            child: ClipRRect(
                borderRadius: BorderRadius.circular(20),
                child: Container(
                  width: double.infinity,
                  height: 100,
                  color: Colors.yellow,
                  child: Row(
                    // 主轴对齐
                    mainAxisAlignment: MainAxisAlignment.start,
                    // 侧轴对齐
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      const SizedBox(width: 10),
                      ClipRRect(
                        borderRadius: BorderRadius.circular(10),
                        child: Image.network(
                            'https://yanxuan-item.nosdn.127.net/afd6199278a5b8fd783bc4947960fabc.jpg',
                            width: 86),
                      ),
                      // 左外边距
                      const SizedBox(width: 10),
                      // 弹性布局
                      const Expanded(
                        flex: 1,
                        child: Text(
                          '茶水分离杯耐热隔热玻璃杯, 茶水分离杯耐热隔热玻璃杯, 茶水分离杯耐热隔热玻璃杯, 茶水分离杯耐热隔热玻璃杯',
                          maxLines: 2,
                          overflow: TextOverflow.ellipsis,
                        ),
                      ),
                    ],
                  ),
                ))));
  }
}

class ColumnAndRowCaseItem extends StatelessWidget {
  const ColumnAndRowCaseItem({super.key});
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 70,
      height: 70,
      margin: const EdgeInsets.only(left: 10),
      child: Container(
        width: double.infinity,
        height: double.infinity,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(35),
          color: Colors.blue,
        ),
      ),
    );
  }
}
